# Paste your code into this box
annualInterestRate = 0.2
balance = 320000
initialBalance = balance
minumumMonthlyPayment = 0.0
monthlyInterestRate = annualInterestRate / 12.0
updatedBalance = balance
unpaidBalance = balance - minumumMonthlyPayment
updatedBalance = unpaidBalance + (unpaidBalance * monthlyInterestRate) 
lowerBound = balance / 12.0
upperBound = (balance * ((1 + monthlyInterestRate)**12)) / 12.0
middleBound = (lowerBound + upperBound) / 2.0
while updatedBalance - balance > 0.1:
    if updatedBalance - balance > 0.1:
         lowerBound = middleBound
    else:
        upperBound = middleBound
    minumumMonthlyPayment += middleBound
    balance = initialBalance

    middleBound = (lowerBound + upperBound) / 2.0
    for month in range(1,13):
        unpaidBalance = updatedBalance - minumumMonthlyPayment
        updatedBalance = unpaidBalance + (unpaidBalance * monthlyInterestRate)  
        
print('Lowest Payment: ' + str(round(minumumMonthlyPayment, 2)))
print(updatedBalance)
